require 'common'
require 'action'
require 'window'

module Evil
  class Server
    def initialize
      @window = Window.new
    end

    def do_action(action)
      Action.constantize(action).new(@editor, @window).execute
    end

    def start(server_port, client_port)
      DRb.start_service("druby://localhost:#{server_port}", self)
      @editor = DRbObject.new(nil, "druby://localhost:#{client_port}")
      @window.main_loop
    end
  end
end





